load("//bazel:tachyon_cc.bzl", "tachyon_cc_library", "tachyon_cc_unittest")

package(default_visibility = ["//visibility:public"])

filegroup(
    name = "univariate_hdrs",
    srcs = [
        "bn254_univariate_dense_polynomial.h",
        "bn254_univariate_evaluation_domain.h",
        "bn254_univariate_evaluations.h",
        "bn254_univariate_rational_evaluations.h",
    ],
)

tachyon_cc_library(
    name = "univariate",
    deps = [":bn254_univariate_evaluation_domain"],
)

tachyon_cc_library(
    name = "bn254_univariate_dense_polynomial",
    srcs = ["bn254_univariate_dense_polynomial.cc"],
    hdrs = [
        "bn254_univariate_dense_polynomial.h",
        "bn254_univariate_dense_polynomial_type_traits.h",
    ],
    deps = [
        "//tachyon/c:export",
        "//tachyon/c/base:type_traits_forward",
        "//tachyon/c/math/polynomials:constants",
        "//tachyon/math/elliptic_curves/bn/bn254:fr",
        "//tachyon/math/polynomials/univariate:univariate_polynomial",
    ],
)

tachyon_cc_library(
    name = "bn254_univariate_evaluation_domain",
    srcs = ["bn254_univariate_evaluation_domain.cc"],
    hdrs = [
        "bn254_univariate_evaluation_domain.h",
        "bn254_univariate_evaluation_domain_type_traits.h",
    ],
    deps = [
        ":bn254_univariate_dense_polynomial",
        ":bn254_univariate_evaluations",
        ":bn254_univariate_rational_evaluations",
        "//tachyon/c/base:type_traits_forward",
        "//tachyon/math/polynomials/univariate:univariate_evaluation_domain",
        "//tachyon/math/polynomials/univariate:univariate_evaluation_domain_factory",
    ],
)

tachyon_cc_library(
    name = "bn254_univariate_evaluations",
    srcs = ["bn254_univariate_evaluations.cc"],
    hdrs = [
        "bn254_univariate_evaluations.h",
        "bn254_univariate_evaluations_type_traits.h",
    ],
    deps = [
        "//tachyon/c/base:type_traits_forward",
        "//tachyon/c/math/elliptic_curves/bn/bn254:fr",
        "//tachyon/c/math/polynomials:constants",
        "//tachyon/math/polynomials/univariate:univariate_evaluations",
    ],
)

tachyon_cc_library(
    name = "bn254_univariate_rational_evaluations",
    srcs = ["bn254_univariate_rational_evaluations.cc"],
    hdrs = [
        "bn254_univariate_rational_evaluations.h",
        "bn254_univariate_rational_evaluations_type_traits.h",
    ],
    deps = [
        ":bn254_univariate_evaluations",
        "//tachyon/base:logging",
        "//tachyon/c/base:type_traits_forward",
        "//tachyon/math/base:rational_field",
    ],
)

tachyon_cc_unittest(
    name = "univariate_unittests",
    srcs = [
        "bn254_univariate_dense_polynomial_unittest.cc",
        "bn254_univariate_evaluation_domain_unittest.cc",
        "bn254_univariate_evaluations_unittest.cc",
        "bn254_univariate_rational_evaluations_unittest.cc",
    ],
    deps = [
        ":bn254_univariate_evaluation_domain",
        ":bn254_univariate_rational_evaluations",
        "//tachyon/base/containers:container_util",
        "//tachyon/cc/math/elliptic_curves/bn/bn254:fr",
        "//tachyon/math/finite_fields/test:finite_field_test",
    ],
)
